package cn.javass.dp.strategy.example3;

/**
 * Created by wanggen on 19/8/3.
 */
public class Client {
    public static void main(String[] args) {
        //创建相应的支付策略
        Strategy strategyRMB = new ConcreteStrategyA();
        Strategy strategyDollar = new ConcreteStrategyB();

        //准备小李的支付工资上下文
        Context ctx1 = new Context("小李",5000,"",strategyRMB);
        //向小李支付工资
        ctx1.contextInterface();

        //切换一个人，给petter支付工资
        Context ctx2 = new Context("Petter",8000,"",strategyDollar);
        ctx2.contextInterface();

        //测试新添加的支付方式
        Strategy strategyCard = new ConcreteStrategyC();
        Context ctx3 = new Context("小王",9000,"010998877656",strategyCard);
        ctx3.contextInterface();

    }
}
